import request from '../request'
//发送验证码
export function sentCode(data) {
  return request({
    url: '/captcha/sent',
    method: 'post',
    data: data
  })
}

//验证验证码
export function verifyCode(data) {
  return request({
    url: '/captcha/verify',
    method: 'post',
    data: data
  })
}
//通过账号密码登录
export function accountPasswordLogin(data) {
  return request({
    url: '/login/cellphone',
    method: 'post',
    data: data
  })
}

//获取二维码key
export function getKey(){
  return request({
    url:'/login/qr/key',
    method:'post'
  })
}

//根据key获取二维码
export function getQrcode(key){
  // console.log(key)
  return request({
    url:'/login/qr/create?key=' + key + '&qrimg=true',
    // method:'post',
    data:'qrimg'
  })
}

//轮询扫码状态
export function check(key){
  // console.log(key)
  return request({
    url:'/login/qr/check?key=' + key + '&timestamp=' + new Date().getTime(),
    // method:'post',
  })
}